#ifndef BIMOSSENSORPRESSURE_H
#define BIMOSSENSORPRESSURE_H

#include "bimossensor.h"


// These are default values for the absoulte pressure sensor
#define DEFAULT_SLOPE 477.62
#define DEFAULT_INTERCEPT 1295.7

class BimosSensorPressure : public BimosSensor
{

    Q_OBJECT


public:

    BimosSensorPressure(int ordinal);

    double getPressure();
    double getMeanPressure();
    double getEvacuationOffset();
    double getPrePressure();


    double getGasYield(double steamPressure, double temperature);



    // calibration values
    qreal slope;
    qreal intercept;

    // volumen
    qreal volumeBottle;
    qreal volumeSludge;
    qreal volumeSubstrat;

    void setPrePressure(double pp);

    friend QDataStream& operator<<(QDataStream &outStream, const BimosSensorPressure &data);
    friend QDataStream& operator>>(QDataStream &inStream, BimosSensorPressure &data);


private:

    qreal evacuationOffset;
    qreal prePressure;

    double getPressure(double v);

    double getVolume();


public slots:
    void setEvacuationOffset(double absoultPressure);
    void setVolt(double newValue);

signals:
    void pressureChanged(BimosSensorPressure*);

friend class QDataStream;
};

#endif // BIMOSSENSORPRESSURE_H
